package net.sx.minemodule.mvp.activities;

import android.os.Bundle;
import android.text.TextUtils;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.homegoods.aroutercomment.ARouterPath;
import com.kedll.library.base.KRefreshListActivity;

import net.sx.minemodule.R;
import net.sx.minemodule.databinding.MineActivityRecordInfoBinding;
import net.sx.minemodule.mvp.presenters.MineRecordInfoPresenter;

/**
 * add shibo.zheng
 * 19/06/17
 * 记录详情activity
 * 佣金/积分/奖牌/提成等界面通过此activity展示详情数据
 */

@Route(path = ARouterPath.PATH_RECORD_INFO)
public class MineRecordInfoActivity extends KRefreshListActivity<MineActivityRecordInfoBinding, MineRecordInfoPresenter> {
    @Autowired(name = "recordInfoType")
    public String recordInfoType;

    @Override
    protected int getLayout() {
        return R.layout.mine_activity_record_info;
    }

    @Override
    protected MineRecordInfoPresenter getPresenter() {
        return new MineRecordInfoPresenter(this);
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        super.initData(savedInstanceState);
        ARouter.getInstance().inject(this);
        if (!TextUtils.isEmpty(recordInfoType)) {
            mPresenter.setRecordInfoType(recordInfoType);
        }
    }

    @Override
    protected void initToolBar(Bundle savedInstanceState) {
        super.initToolBar(savedInstanceState);
        ARouter.getInstance().inject(this);
        if (!TextUtils.isEmpty(recordInfoType)) {
            if ("brokerageHistory".equals(recordInfoType)) {            //历史返佣记录
                setTitle("历史返佣记录");
            } else if ("brokerageList".equals(recordInfoType)) {        //佣金明细
                setTitle("佣金明细");
            } else if ("medalHistory".equals(recordInfoType)) {         //历史奖牌记录
                setTitle("历史奖牌记录");
            } else if ("medalInfo".equals(recordInfoType)) {            //奖牌明细
                setTitle("奖牌明细");
            } else if ("HistoryCommission".equals(recordInfoType)) {    //历史提成记录
                setTitle("历史提成明细");
            } else if ("CommissionList".equals(recordInfoType)) {       //提成明细
                setTitle("提成明细");
            }
        }
    }
}
